<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>new 关键字做了什么</title>
</head>
<body>
    <script>
      function Cat(name,color){
        this.name = name;
        this.color = color;
        this.say = function(){alert("喵喵")}
      }
      // 01 创建一个空对象
      var obj = {};
      // 02 执行构造函数传参空对象冒充this
      Cat.call(obj,"大黄","黄色")
      // 03 修改对象原型的构造函数
      obj.__proto__.constructor = Cat;
    </script>
</body>
</html>